package com.xinjian.jianba.service.impl;

import java.sql.Date;
import java.sql.Timestamp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinjian.jianba.dao.dwmid.UserReportDao;
import com.xinjian.jianba.dto.UserReportDto;
import com.xinjian.jianba.enity.UserReportEntity;
import com.xinjian.jianba.service.UserReportService;
@Service
public class UserReportServiceImpl implements UserReportService{

	@Autowired
	private UserReportDao userReportDao;
	@Override
	public int userReport(UserReportDto userReportDto) {
		long time=new java.util.Date().getTime();
		Date date=new Date(time);
		UserReportEntity userReportEntity=new UserReportEntity();
		userReportEntity.setAddTime(new Timestamp(time));
		userReportEntity.setContent(userReportDto.getContent());
		userReportEntity.setRelationId(userReportDto.getRelationId());
		userReportEntity.setStatus(0);
		userReportEntity.setTimeAdd(date);
		userReportEntity.setType(null);
		userReportEntity.setUrl(null);
		userReportEntity.setUserId(userReportDto.getUserId());
		int result=userReportDao.insert(userReportEntity);
		return result;
	}

}
